package com.zq.learn.springbatch.combination;

import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * OrderController
 *
 * @author ZhangQi
 * @date 2020/2/19
 */
@RestController
public class OrderController {
  @Autowired
  private OrderService orderService;

  /**
   * 动态操作任务测试
   * @param status 操作：0-创建任务；1-暂停任务；2-恢复任务；3-删除任务；
   */
  @GetMapping("/order/test")
  public void orderTest(@RequestParam(required = true) Integer status){
    try {
      orderService.orderTest(status);
    } catch (SchedulerException e) {
      e.printStackTrace();
    }
  }
}
